/* eslint-disable import/prefer-default-export */
import { Ajax, AjaxuploadFile } from "./http";

/**
 * 微信登录获取token
 * @param String code wx.login的code
 */
export const oauthtoken = (data) => {
  return Ajax({
    url: `/server-auth/oauth/token`,
    method: "get",
    data,
  });
};

/**
 * 获取用户信息
 */
export const userinfo = () => {
  return Ajax({
    url: `/server-user/wap/user/info`,
    method: "get",
  });
};

/**
 * 获取手机验证码
 * @param object data
 */
export const smsCode = (data) => {
  return Ajax({
    url: "/server-auth/sign-up/sms/code",
    data,
  });
};

/**
 * 获取后台首页装修
 * @param object data
 */
export const adornInfo = (data) => {
  return Ajax({
    url: "/server-shop/wap/adorn/info",
    data,
  });
};

/**
 * 获取后台首页装修
 * @param object data
 */
export const adornDetail = (data) => {
  return Ajax({
    url: "/server-shop/wap/adorn/detail",
    data,
  });
};

/**
 * 获取平台商品分类树
 */
export const goodsCategoryTree = () => {
  return Ajax({
    url: "/server-shop/wap/goods/category/tree",
  });
};

/**
 * 公告列表
 */
export const bulletinList = () => {
  return Ajax({
    url: "/server-base/wap/bulletin/list",
  });
};

/**
 * 公告列表 - 分页
 * @param object data
 * current 页码
 * size 数量
 */
export const bulletinPage = (data) => {
  return Ajax({
    url: "/server-base/wap/bulletin/page",
    data,
  });
};

/**
 * 公告详情
 * @param object data
 * id 公告id
 */
export const bulletinInfo = (data) => {
  return Ajax({
    url: "/server-base/wap/bulletin/info",
    data,
  });
};

/**
 * 商品列表 - 分页
 * @param object data
 * current 页码
 * size 数量
 */
export const goodsPage = (data) => {
  return Ajax({
    url: "/server-shop/wap/goods/page",
    data,
  });
};

/**
 * 行政区域
 * @param object data
 * code 编码
 */
export const regionList = (data) => {
  return Ajax({
    url: "/server-shop/wap/region/list",
    data,
  });
};

/**
 * 收货地址列表
 */
export const addressList = () => {
  return Ajax({
    url: "/server-shop/wap/user/address/list",
  });
};

/**
 * 收获地址保存编辑
 * @param object data
 */
export const addressSubmit = (data) => {
  return Ajax({
    url: "/server-shop/wap/user/address/submit",
    data,
    method: "post",
  });
};

/**
 * 收获地址详情
 * @param object data
 * id
 */
export const addressInfo = (data) => {
  return Ajax({
    url: "/server-shop/wap/user/address/info",
    data,
  });
};

/**
 * 收获地址 - 删除
 * @param object data
 * id
 */
export const addressRemove = (data) => {
  return Ajax({
    url: "/server-shop/wap/user/address/remove",
    data,
    method: "post",
  });
};

/**
 * 设置为默认地址
 * @param object data
 * id
 */
export const addressSet = (data) => {
  return Ajax({
    url: "/server-shop/wap/user/address/set",
    data,
    method: "post",
  });
};

/**上传图片OSS**/
export const putFileOSS = (filePath) => {
  return AjaxuploadFile({
    url: `/server-resource/oss/endpoint/put/file`,
    filePath,
  });
};

/**上传到服务器**/
export const uploadFile = (filePath) => {
  return AjaxuploadFile({
    url: `/server-resource/oss/endpoint/upload/file`,
    filePath,
  });
};

/**
 * 公众号JsAPI签名
 * @param Object data
 */
export const wxJsapiSignature = (data) => {
  return Ajax({
    url: `/server-auth/oauth/wechat/js-signature`,
    data,
    method: "post",
  });
};

/*****
 * 种草板块接口
 * /

/**
 *分类
 */
export const topicCategoryList = () => {
  return Ajax({
    url: `/server-social/wap/topic/category/list`,
  });
};

/**
 *话题
 @param String isHot
 */
export const topicTagList = (data) => {
  return Ajax({
    url: `/server-social/wap/topic/tag/list`,
    data,
  });
};

/**
 *发布
 @param Object
 */
export const topicSave = (data) => {
  return Ajax({
    url: `/server-social/wap/topic/save`,
    data,
    method: "POST",
  });
};

/**
 *编辑
 @param Object
 */
export const topicUpdate = (data) => {
  return Ajax({
    url: `/server-social/wap/topic/update`,
    data,
    method: "POST",
  });
};

/**
 *列表
 */
export const topicPushPage = (data) => {
  return Ajax({
    url: `/server-social/wap/topic/push/page`,
    data,
  });
};

/**
 *关联列表商品数据
 */
export const topicGoodsList = (data) => {
  return Ajax({
    url: `/server-social/wap/topic/user/goods/list`,
    data,
  });
};

/**
 *平台商品分类
  @param string parentId
 */
export const goodsCategoryList = (data) => {
  return Ajax({
    url: `/server-shop/wap/goods/category/list`,
    data,
  });
};

/**
 *商品详情
  @param string id
 */
export const goodsInfo = (data) => {
  return Ajax({
    url: `/server-shop/wap/goods/info`,
    data,
  });
};

/**
 *商户详情
  @param string id
 */
export const sellerInfo = (data) => {
  return Ajax({
    url: `/server-shop/wap/seller/info`,
    data,
  });
};

/**
 *收藏商品
  @param string id
 */
export const favoriteSave = (data) => {
  return Ajax({
    url: `/server-shop/wap/favorite/save`,
    data,
    method: "post",
  });
};

/**
 *取消收藏
  @param string ids
 */
export const favoriteRemove = (data) => {
  return Ajax({
    url: `/server-shop/wap/favorite/remove?ids=${data.ids}`,
    data,
    method: "post",
  });
};

/**
 *添加商品到购物车
  @param Object
 */
export const cartSave = (data) => {
  return Ajax({
    url: `/server-shop/wap/cart/save`,
    data,
    method: "post",
  });
};

/**
 *修改购物车商品
  @param Object
 */
export const cartUpdate = (data) => {
  return Ajax({
    url: `/server-shop/wap/cart/update`,
    data,
    method: "post",
  });
};

/**
 *预生成订单
  @param Object
 */
export const orderConfirm = (data) => {
  return Ajax({
    url: `/server-shop/wap/order/confirm`,
    data,
    method: "post",
  });
};

/**
 *领券中心
  @param Object
 */
export const couponPage = (data) => {
  return Ajax({
    url: `/server-shop/wap/coupon/page`,
    data,
  });
};

/**
 *优惠券领取
  @param Object
 */
export const couponReceive = (data) => {
  return Ajax({
    url: `/server-shop/wap/coupon/receive`,
    data,
    method: "post",
  });
};

/**
 *提交订单
  @param Object
 */
export const orderSubmit = (data) => {
  return Ajax({
    url: `/server-shop/wap/order/submit`,
    data,
    method: "post",
  });
};

/**
 *订单支付
  @param Object
 */
export const payOrder = (data) => {
  return Ajax({
    url: `/server-pay/order`,
    data,
    method: "post",
  });
};

/**
 *订单分页
  @param Object
 */
export const orderPage = (data) => {
  return Ajax({
    url: `/server-shop/wap/order/page`,
    data,
  });
};

/**
 *订单取消
  @param Object
 */
export const orderCancel = (data) => {
  return Ajax({
    url: `/server-shop/wap/order/cancel`,
    data,
    method: "post",
  });
};

/**
 *确认收货
  @param Object
 */
export const orderReceipt = (data) => {
  return Ajax({
    url: `/server-shop/wap/order/receipt`,
    data,
    method: "post",
  });
};

/**
 *订单详情
  @param Object
 */
export const orderInfo = (data) => {
  return Ajax({
    url: `/server-shop/wap/order/info`,
    data,
  });
};

/**
 *订单评价
  @param Object
 */
export const orderComment = (data) => {
  return Ajax({
    url: `/server-shop/wap/order/comment`,
    data,
    method: "post",
  });
};

/**
 *获取购物车商品列表
  @param Object
 */
export const cartList = (data) => {
  return Ajax({
    url: `/server-shop/wap/cart/list`,
    data,
  });
};

/**
 *购物车删除
  @param Object
 */
export const cartRemove = (data) => {
  return Ajax({
    url: `/server-shop/wap/cart/remove?ids=${data.ids}`,
    data,
    method: "post",
  });
};

/**
 *商品评论列表
  @param Object
 */
export const goodsCommentPage = (data) => {
  return Ajax({
    url: `/server-shop/wap/goods/comment/page`,
    data,
  });
};

/**
 *商品评论列表
  @param Object
 */
export const couponUserPage = (data) => {
  return Ajax({
    url: `/server-shop/wap/coupon/user/page`,
    data,
  });
};

/**
 *收藏分页
  @param Object
 */
export const favoritePage = (data) => {
  return Ajax({
    url: `/server-shop/wap/favorite/page`,
    data,
  });
};

/**
 *足迹分页
  @param Object
 */
export const footprintPage = (data) => {
  return Ajax({
    url: `/server-shop/wap/footprint/page`,
    data,
  });
};

/**
 *取消收藏
  @param string ids
 */
export const footprintRemove = (data) => {
  return Ajax({
    url: `/server-shop/wap/footprint/remove?ids=${data.ids}`,
    data,
    method: "post",
  });
};

/**
 *帮助中心
  @param Object
 */
export const helpList = (data) => {
  return Ajax({
    url: `/server-base/wap/help/list`,
    data,
  });
};

/**
 *协议详情
  @param Object
 */
export const protocolInfo = (data) => {
  return Ajax({
    url: `/server-base/wap/protocol/info`,
    data,
  });
};

/**
 *更新基础信息
  @param Object
 */
export const updateBase = (data) => {
  return Ajax({
    url: `/server-user/wap/user/update/base`,
    data,
    method: "post",
  });
};

/**
 *标签列表
  @param Object
 */
export const tagList = (data) => {
  return Ajax({
    url: `/server-user/wap/user/tag/list`,
    data,
  });
};

/**
 *签到明细记录
  @param Object
 */
export const signList = (data) => {
  return Ajax({
    url: `/server-user/wap/user/sign/list`,
    data,
  });
};

/**
 签到日历
  @param Object
 */
export const userSignInfo = (data) => {
  return Ajax({
    url: `/server-user/wap/user/sign/info`,
    data,
  });
};

/**
 签到
  @param Object
 */
export const userSignSignIn = (data) => {
  return Ajax({
    url: `/server-user/wap/user/sign/signIn`,
    data,
    method: "post",
  });
};

/**
 社区详情
  @param Object
 */
export const topicInfo = (data) => {
  return Ajax({
    url: `/server-social/wap/topic/info`,
    data,
  });
};

/**
 点赞
  @param Object
 */
export const likesSave = (data) => {
  return Ajax({
    url: `/server-social/wap/likes/save`,
    data,
    method: "post",
  });
};

/**
 删除点赞
  @param Object
 */
export const likesRemove = (data) => {
  return Ajax({
    url: `/server-social/wap/likes/remove?id=${data.id}`,
    data,
    method: "post",
  });
};

/**
 发表评论
  @param Object
 */
export const commentSave = (data) => {
  return Ajax({
    url: `/server-social/wap/comment/save`,
    data,
    method: "post",
  });
};

/**
 评论列表
  @param Object
 */
export const socialCommentPage = (data) => {
  return Ajax({
    url: `/server-social/wap/comment/page`,
    data,
  });
};

/**
 社区用户信息
  @param Object
 */
export const socialUserInfo = (data) => {
  return Ajax({
    url: `/server-social/wap/user/info`,
    data,
  });
};

/**
 我的作品
  @param Object
 */
export const userTopicPage = (data) => {
  return Ajax({
    url: `/server-social/wap/user/topic/page`,
    data,
  });
};

/**
 点赞作品
  @param Object
 */
export const userLikesPage = (data) => {
  return Ajax({
    url: `/server-social/wap/user/likes/page`,
    data,
  });
};

/**
 评论记录
  @param Object
 */
export const userCommentPage = (data) => {
  return Ajax({
    url: `/server-social/wap/user/comment/page`,
    data,
  });
};

/**
 分销员申请
  @param Object
 */
export const placeApplySave = (data) => {
  return Ajax({
    url: `/server-shop/wap/place/apply/save`,
    data,
    method: "post",
  });
};

/**
 分销员修改
  @param Object
 */
export const placAapplyUpdate = (data) => {
  return Ajax({
    url: `/server-shop/wap/place/apply/update`,
    data,
    method: "post",
  });
};

/**
 分销员申请记录
  @param Object
 */
export const placeApplyPage = (data) => {
  return Ajax({
    url: `/server-shop/wap/place/apply/page`,
    data,
  });
};

/**
 分销员申请详情
  @param Object
 */
export const applyInfo = (data) => {
  return Ajax({
    url: `/server-shop/wap/place/apply/info`,
    data,
  });
};

/**
 推广统计
  @param Object
 */
export const placeTotal = (data) => {
  return Ajax({
    url: `/server-shop/wap/place/total`,
    data,
  });
};

/**
 等级列表
  @param Object
 */
export const levelList = (data) => {
  return Ajax({
    url: `/server-user/wap/user/level/list`,
    data,
  });
};

/**
 佣金记录统计
  @param Object
 */
export const placeOrderSettleTotal = (data) => {
  return Ajax({
    url: `/server-shop/wap/place/order/settle/total`,
    data,
  });
};

/**
 佣金记录和推广人订单
  @param Object
 */
export const placeOrderSettlePage = (data) => {
  return Ajax({
    url: `/server-shop/wap/place/order/settle/page`,
    data,
  });
};

/**
 我加入的店铺
  @param Object
 */
export const placeSellerList = (data) => {
  return Ajax({
    url: `/server-shop/wap/place/seller/list`,
    data,
  });
};

/**
 查看分销规则
  @param Object
 */
export const placeSellerRule = (data) => {
  return Ajax({
    url: `/server-shop/wap/place/seller/rule`,
    data,
  });
};

/**
 下级列表
  @param Object
 */
export const placeUserPage = (data) => {
  return Ajax({
    url: `/server-shop/wap/place/user/page`,
    data,
  });
};

/**
 余额积分分页
  @param Object
 */
export const userWalletPage = (data) => {
  return Ajax({
    url: `/server-user/wap/user/wallet/page`,
    data,
  });
};

/**
 活动列表
  @param Object
 */
export const publicityList = (data) => {
  return Ajax({
    url: `/server-shop/wap/publicity/list`,
    data,
  });
};

/**
 活动列表商品
  @param Object
 */
export const publicityGoodsPage = (data) => {
  return Ajax({
    url: `/server-shop/wap/publicity/goods/page`,
    data,
  });
};

/**
 活动详情
  @param Object
 */
export const publicityInfo = (data) => {
  return Ajax({
    url: `/server-shop/wap/publicity/info`,
    data,
  });
};

/**
 轮播
  @param Object
 */
export const bannerList = (data) => {
  return Ajax({
    url: `/server-base/wap/banner/list`,
    data,
  });
};

/**
 推荐人排行榜
  @param Object
 */
export const placeUserRankList = (data) => {
  return Ajax({
    url: `/server-shop/wap/place/user/rank/list`,
    data,
  });
};

/**
 佣金排行榜
  @param Object
 */
export const placeOrderRankList = (data) => {
  return Ajax({
    url: `/server-shop/wap/place/order/rank/list`,
    data,
  });
};

/**
 商户申请新增
  @param Object
 */
export const sellerApplySave = (data) => {
  return Ajax({
    url: `/server-shop/wap/seller/apply/save`,
    data,
    method: "post",
  });
};

/**
 商户申请修改
  @param Object
 */
export const sellerApplyUpdate = (data) => {
  return Ajax({
    url: `/server-shop/wap/seller/apply/update`,
    data,
    method: "post",
  });
};

/**
 商户申请记录
  @param Object
 */
export const sellerApplyList = (data) => {
  return Ajax({
    url: `/server-shop/wap/seller/apply/list`,
    data,
  });
};

/**
 商户申请详情
  @param Object
 */
export const sellerApplyInfo = (data) => {
  return Ajax({
    url: `/server-shop/wap/seller/apply/info`,
    data,
  });
};

/**
 商户分类
  @param Object
 */
export const sellerApplyCategoryList = (data) => {
  return Ajax({
    url: `/server-shop/wap/seller/apply/category/list`,
    data,
  });
};

/**
 商户类型
  @param Object
 */
export const sellerApplyTypeList = (data) => {
  return Ajax({
    url: `/server-shop/wap/seller/apply/type/list`,
    data,
  });
};

/**
 店铺街
  @param Object
 */
export const sellerPage = (data) => {
  return Ajax({
    url: `/server-shop/wap/seller/page`,
    data,
  });
};

/**
 商户商品分类
  @param Object
 */
export const sellerGoodsCategoryList = (data) => {
  return Ajax({
    url: `/server-shop/wap/seller/goods/category/list`,
    data,
  });
};

/**
 申请售后
  @param Object
 */
export const orderRefundApply = (data) => {
  return Ajax({
    url: `/server-shop/api/order/refund/apply`,
    data,
    method: "post",
  });
};

/**
订单角标
  @param Object
 */
export const orderCount = (data) => {
  return Ajax({
    url: `/server-shop/wap/order/count`,
    data,
  });
};

/**
 取消售后
  @param Object
 */
export const orderRefundCancel = (data) => {
  return Ajax({
    url: `/server-shop/api/order/refund/cancel`,
    data,
    method: "post",
  });
};

/**
售后详情
  @param Object
 */
export const orderRefundInfo = (data) => {
  return Ajax({
    url: `/server-shop/api/order/refund/info`,
    data,
  });
};

/**
售后分页
  @param Object
 */
export const orderRefundPage = (data) => {
  return Ajax({
    url: `/server-shop/api/order/refund/page`,
    data,
  });
};

/**
填写物流
  @param Object
 */
export const orderRefundShippingSave = (data) => {
  return Ajax({
    url: `/server-shop/api/order/refund/shipping/save`,
    data,
    method: "post",
  });
};

/**
修改物流
  @param Object
 */
export const orderRefundShippingUpdate = (data) => {
  return Ajax({
    url: `/server-shop/api/order/refund/shipping/update`,
    data,
    method: "post",
  });
};

/**
修改物流
  @param Object
 */
export const dictbizlist = (data) => {
  return Ajax({
    url: `/server-open/dict/list`,
    data,
  });
};

/**
配置
  @param Object
 */
export const config = (data) => {
  return Ajax({
    url: `/server-open/config`,
    data,
  });
};

/**
订单物流
  @param Object
 */
export const orderTrack = (data) => {
  return Ajax({
    url: `/server-shop/wap/order/track`,
    data,
  });
};

/**
获取授权手机号
  @param Object
 */
export const wechatMobile = (data) => {
  return Ajax({
    url: `/server-auth/wechat/mobile`,
    data,
  });
};

/**
绑定手机号
  @param Object
 */
export const updateMobile = (data) => {
  return Ajax({
    url: `/server-user/wap/user/update/mobile`,
    data,
    method: "post",
  });
};

/**
更新推荐人
  @param Object
 */
export const updateParent = (data) => {
  return Ajax({
    url: `/server-user/wap/user/update/parent`,
    data,
    method: "post",
  });
};

/**
当前用户等级信息
  @param Object
 */
export const levelNow = (data) => {
  return Ajax({
    url: `/server-user/wap/user/level/now`,
    data,
  });
};

/**
经验值记录
  @param Object
 */
export const levelLogPage = (data) => {
  return Ajax({
    url: `/server-user/wap/user/level/log/page`,
    data,
  });
};

/**
经验值记录
  @param Object
 */
export const goodslistids = (data) => {
  return Ajax({
    url: `/server-shop/wap/goods/list`,
    data,
  });
};

/**
获取新人优惠券弹窗
  @param Object
 */
export const couponNewcomer = (data) => {
  return Ajax({
    url: `/server-shop/wap/coupon/newcomer`,
    data,
  });
};

/**

获取生日优惠券弹窗
  @param Object
 */
export const couponBirthday = (data) => {
  return Ajax({
    url: `/server-shop/wap/coupon/birthday`,
    data,
  });
};

/**
设置小程序二维码参数
  @param Object
 */
export const codeSetScene = (data) => {
  return Ajax({
    url: `/server-auth/wechat/share/code/set/scene`,
    data,
  });
};

/**
获取小程序二维码参数
  @param Object
 */
export const codeGetScene = (data) => {
  return Ajax({
    url: `/server-auth/wechat/share/code/get/scene`,
    data,
  });
};

/**
获取URL Link
  @param Object
 */
export const wechatUrlLink = (data) => {
  return Ajax({
    url: `/server-auth/wechat/url/link`,
    data,
  });
};

/**
修改地址
  @param Object
 */
export const updateAddress = (data) => {
  return Ajax({
    url: `/server-shop/wap/order/update/address`,
    data,
    method: "post",
  });
};

/**
核销订单
  @param Object
 */
export const orderVerify = (data) => {
  return Ajax({
    url: `/server-shop/wap/order/verify`,
    data,
    method: "post",
  });
};

/**
获取参数
  @param Object
 */
export const paramConfig = (data) => {
  return Ajax({
    url: `/server-open/param`,
    data,
    method: "get",
  });
};

/**
文本内容安全识别
  @param Object
 */
export const wechatMsgSecCheck = (data) => {
  return Ajax({
    url: `/server-auth/wechat/msg/sec/check`,
    data,
    method: "POST",
  });
};

/**
商户地址列表
  @param Object 商户id
 */
export const sellerAddressList = (data) => {
  return Ajax({
    url: `/server-shop/wap/seller/address/list`,
    data,
  });
};

/**
获取预览token
 */
export const previewToken = (data) => {
  return Ajax({
    url: `/server-open/preview/token`,
    data,
  });
};

/**
 */
export const adornGetData = (data) => {
  return Ajax({
    url: `/server-shop/wap/adorn/get/data`,
    data,
  });
};
